package cn.cdeden.knowledge.service;


import cn.cdeden.common.core.utils.page.TableDataInfo;
import cn.cdeden.knowledge.domain.SysDocLog;
import cn.cdeden.knowledge.domain.SysLogPerm;
import cn.cdeden.knowledge.domain.dto.SysDocLogDto;
import cn.cdeden.knowledge.domain.dto.SysDocLogQueryParam;
import cn.cdeden.knowledge.enums.TreeEnum;
import cn.cdeden.system.api.model.LoginUser;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Set;

/**
* @author GW
* @date 2024-01-19
*/
public interface SysDocLogService extends IService<SysDocLog> {

    static final String CACHE_KEY = "sysEnterpriseLog";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<SysEnterpriseLogDto>
    */
    TableDataInfo<SysDocLogDto> queryAll(SysDocLogQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<SysEnterpriseLogDto>
    */
    List<SysDocLogDto> queryAll(SysDocLogQueryParam query);

    SysDocLog getById(Long id);
    SysDocLogDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    boolean insert(SysDocLogDto resources);
    boolean updateById(SysDocLogDto resources);
    boolean deleteById(Long id);
    boolean deleteByIds(Set<Long> ids);

    void createLog(String documentId, LoginUser userDto, TreeEnum type, String operationType, String documentName, String documentPath, String documentStatus);

    void createPermLog(String documentId,LoginUser userDto, TreeEnum type, String operationType, String documentName, String documentPath, String documentStatus, List<SysLogPerm> sysLogPermDtos);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<SysEnterpriseLogDto> all, HttpServletResponse response) throws IOException;
}
